object ScalaExceptionDemo01 {
  def main(args: Array[String]): Unit = {
    try {
      val r = 10 / 0
    } catch {
      case ex: ArithmeticException => {
        println("捕获了除数为零的算数异常")
        ex.printStackTrace()
      }
      case ex: Exception => println("捕获了异常")
    } finally {
      // 最终要执⾏的代码
      println("scala finally...")
    }
  }
}
